<template>
    <div>
        <el-row :gutter="20" class="panel-group">
            <el-col :xs="12" :sm="8" :lg="4" :xl="4" class="card-panel-col" v-for="(item , index) in arr" :key="index">
                <div class="card-panel">
                    <div :class="'card-panel-icon-wrapper icon-'+item.ico">
                    <!-- <svg-icon :icon-class="item.ico" class-name="card-panel-icon" /> -->
                    <div class="card-panel-icon">
                       <i class="el-icon-s-data"></i>
                    </div>
                    </div>
                    <div class="card-panel-description">
                      <div class="card-panel-text">{{item.name}}
                      </div>
                      <div class="card-panel-num">
                            <count-to :start-val="0" :end-val="item.number" :duration="1000"></count-to>
                      </div>
                    </div>
                </div>
            </el-col>
            <el-col :xs="24" :sm="24" :lg="9" :xl="9" class="morenumber">
              <div>总收入：
                <el-tooltip placement="bottom-end">
                  <div slot="content">直投及优先交易发生的收入 <br/>
                    是根据媒体在广告投放中填写的单价来计算（不填则不计算），<br/>
                    默认只结算竞价广告收入。 详情
                    </div>
                  <div class="ico">?</div>
                </el-tooltip>
                <p>
                  ￥<count-to :start-val="0" :end-val="555217.20" :duration="1700"></count-to>
                </p>
              </div>
            </el-col>
        </el-row>
    </div>
</template>
<script>
    import CountTo from 'vue-count-to'
    export default{
        data(){
            return{
                arr:[
                    {
                        name:"收入",
                        ico:'money',
                        number:0.00,
                    },
                    {
                        name:"点击量",
                        ico:'money',
                        number:0.00,
                    },
                    {
                        name:"展现量",
                        ico:'money',
                        number:0.00,
                    },
                ]
            }
        },
        components:{
            CountTo
        },
        methods:{
            tab(val){
                this.$emit("tab",val)
            }
        }
    }
</script>
<style lang="scss" scoped>
        .panel-group {
        margin-top: 15px;
      .card-panel-col {
        margin-bottom: 20px;
        &:nth-child(1)  .card-panel .icon-money { color: #40c9c6;}
        &:nth-child(2)  .card-panel .icon-money { color: #36a3f7;}
        &:nth-child(1)  .card-panel:hover .icon-money { background: #40c9c6;color: #fff;}
        &:nth-child(2)  .card-panel:hover .icon-money { background: #36a3f7;color: #fff;}
      }

      .card-panel {
        height: 100px;
        cursor: pointer;
        font-size: 30px;
        position: relative;
        overflow: hidden;
        color: #666;
        background: #fff;
        box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
        border-color: rgba(0, 0, 0, .05);
        display: flex;
        align-items: center;
        padding: 0 20px;
        &:hover {
          .card-panel-icon-wrapper {
            color: #fff;
          }

          .icon-peoples {
            background: #40c9c6;
          }

          .icon-message {
            background: #36a3f7;
          }

          .icon-money {
            background: #f4516c;
          }

          .icon-shopping {
            background: #34bfa3
          }
          .icon-search {
            background: #5234bf
          }
          .icon-yuyan {
            background: #bf3446
          }
        }

        .icon-peoples {
          color: #40c9c6;
        }

        .icon-message {
          color: #36a3f7;
        }

        .icon-money {
          color: #f4516c;
        }

        .icon-shopping {
          color: #34bfa3;
        }
        .icon-search {
            color: #5234bf;
          }
          .icon-yuyan {
            color: #bf3446;
          }
        

        .card-panel-icon-wrapper {
          float: left;
          transition: all 0.38s ease-out;
          border-radius: 6px;
          text-align: center;
          width: 90px;
          height: 80px;
        display: flex;
        align-items: center;
        justify-items: center;
        }

        .card-panel-icon {
          font-size: 50px;
          margin: 0 auto;
        }
        .card-panel-description {
          font-weight: bold;
          margin-left: 10px;
          flex: 1;
          overflow: hidden;
          .card-panel-text {
            line-height: 18px;
            color: rgba(0, 0, 0, 0.45);
            font-size: 14px;
            margin-bottom: 5px;
          }
          .card-panel-num {
            font-size: 20px;
          }
        }
      }
    }

      @media screen and (min-width:1200px) and (max-width:1600px){
          .panel-group {
              .card-panel{
                  padding: 0 10px;
          .card-panel-icon-wrapper {
              width: 60px;
            height: 60px;
          }
          .card-panel-icon {
              font-size: 45px;
          }
      }
        }
        .card-panel-description {
        font-size: 14px;
      }
    
    }
    @media (max-width:550px) {
      .card-panel-icon-wrapper {
        width: 50px !important;
        height: 50px !important;
        .svg-icon {
          font-size: 20px !important;
          display: block;
          margin: 14px auto !important;
          float: none !important;
        }
      }
      .card-panel-description{
        .card-panel-text{
          font-size: 14px  !important;
        }
        font-size: 14px  !important;
      }
      .panel-group {
        padding: 0px;
      }
      .card-panel{
        padding: 0 10px !important;
        height: 90px !important;
      }
      .card-panel-icon-wrapper {
        float: none !important;
        margin: 0 !important;
      

        
      }
     
    }
   
    .morenumber{
      text-align: right;
      color: #888;
      font-size: 14px;
      line-height: 30px;
      padding-top: 60px;
      .ico{
        display: inline-block;
        vertical-align: middle;
        height: 18px;
        line-height: 18px;
        background: rgba(0, 0, 0, 0.3);
        color: #fff;
        width: 18px;
        border-radius: 50%;
        text-align: center;
        cursor: pointer;
        margin-right: 5px;
        font-size: 12px;
      }
      p{
          display: inline-block;
          vertical-align: middle;
          color:#377dff;
          font-size: 14px;
          span{
            font-size: 16px;
          }
      }

    }
      @media (max-width:1200px) {
          .morenumber{
            padding-top: 00px;
            padding-bottom: 10px;
          }
     }
</style>